
RewriteEngine on
RewriteOptions inherit

# ============================================================================
# HEADERS DE COMPATIBILIDADE - Para Android (HTTP)
# ============================================================================
<IfModule mod_headers.c>
    # CORS - Permite acesso remoto
    Header set Access-Control-Allow-Origin "*"
    Header set Access-Control-Allow-Methods "GET, POST, OPTIONS"
    Header set Access-Control-Allow-Headers "Content-Type, Authorization"
    
    # Compatibilidade com Android
    Header set X-Content-Type-Options "nosniff"
    Header set X-Frame-Options "SAMEORIGIN"
    
    # Cache para M3U (permite cache local no app)
    Header set Cache-Control "public, max-age=3600"
    Header set Pragma "public"
    Header set Expires "none"
</IfModule>

# ============================================================================
# AUMENTO DE LIMITES - Upload
# ============================================================================
php_value upload_max_filesize 100M
php_value post_max_size 100M
php_value max_input_time 600
php_value max_execution_time 600

# ============================================================================
# COMPATIBILIDADE PHP - Socket timeout
# ============================================================================
php_value default_socket_timeout 30

# ============================================================================
# MIME TYPES - Para M3U/HLS
# ============================================================================
<IfModule mod_mime.c>
    AddType application/vnd.apple.mpegurl .m3u8
    AddType audio/x-mpegurl .m3u
    AddType application/x-mpegurl .m3u
</IfModule>

# ============================================================================
# COMPRESSÃO GZIP - Para apps Mobile
# ============================================================================
<IfModule mod_deflate.c>
    AddOutputFilterByType DEFLATE text/html text/plain
    AddOutputFilterByType DEFLATE application/vnd.apple.mpegurl
    AddOutputFilterByType DEFLATE audio/x-mpegurl
</IfModule>

# ============================================================================
# php -- BEGIN cPanel-generated handler, do not edit
# Defina o pacote "ea-php74" como a linguagem padrão de programação "PHP".
# ============================================================================
<IfModule mime_module>
  AddHandler application/x-httpd-ea-php74 .php .php7 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit
